package hn.sigit.view.output;

import hn.sigit.model.hnd.administrative.HND_OperationPermit;
import hn.sigit.logic.queries.OperationPermitQueryHelper;

import java.io.Serializable;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Name("operationPermitCertificateHelper")
@Scope(value=ScopeType.CONVERSATION)
@AutoCreate
public class OperationPermitCertificateHelper extends OutputHelperBase implements Serializable {
	private static final long serialVersionUID = 1L;

	@In
	private OperationPermitQueryHelper operationPermitQueryHelper;

	
	public HND_OperationPermit getPermit() {
		return operationPermitQueryHelper.getSelected();
	}
	public void setPermit(HND_OperationPermit permit) {
		operationPermitQueryHelper.setSelected(permit);
	}
	
	public String getLandUsesText() {
		if (getPermit() != null)
			return landUsesText(getPermit().getLandUse(), getPermit().getOtherLandUses());
		
		return "-";
	}
}
